Option Explicit On 
Option Strict Off

'*******************************************************************
' Program: Data Center Visio Rack Tool
' Author: Albert E Edlund
' Date:
'
' Purpose: this form is the snmp management form
' SNMP_RFC1213_MIB_icmp
' SNMP_RFC1213_MIB_ifTable
' SNMP_RFC1213_MIB_ipAddrTable
' SNMP_RFC1213_MIB_ipRouteTable
' SNMP_RFC1213_MIB_System

' mgmtclassgen SNMP_RFC1213_MIB /n root\snmp /l VB /p c:\rfc1213.vb

'*********************************************************************

Imports System
Imports System.Text
Imports Microsoft.VisualBasic
Imports System.Diagnostics
Imports WbemScripting
Imports System.Management
Imports System.Management.Instrumentation
Imports System.Windows.Forms
Imports System.Windows.Forms.Control
Imports System.Drawing
Imports System.Collections
Imports System.Runtime.InteropServices
Imports System.Reflection

Imports System.Data

Imports visRackSysMgmt.SnmpResults
Imports visRackSysMgmt.frmReportViewer
Imports visRackSysMgmt.clsDC_RackReporting


Imports Microsoft.Practices.EnterpriseLibrary.Common
Imports Microsoft.Practices.EnterpriseLibrary.ExceptionHandling



Public Class frmSNMPMgmt
    Inherits System.Windows.Forms.Form




#Region " Windows Form Designer generated code "


    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()


        'Dim visApp As Visio.Application
        'visApp = g_visApp
        'Dim intObjCount As Integer
        'intObjCount = visApp.ActiveWindow.Selection.Count
        'Dim visShape As Visio.Shape
        'If intObjCount = 1 Then
        '    visShape = visApp.ActiveWindow.Selection.Item(1)
        '    If visShape.CellExists("prop.ipaddress", False) Then
        '        Me.txtSNMP_IPaddress.Text = ReadANamedCustomProperty(visShape, "IpAddress", False)
        '    End If
        'End If

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents cmdCloseSysMgmt As System.Windows.Forms.Button
    Friend WithEvents tbSNMPSetup As System.Windows.Forms.TabPage
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents lstMibs As System.Windows.Forms.ListBox
    Friend WithEvents lblSNMPRWCommunity As System.Windows.Forms.Label
    Friend WithEvents lblSNMPReadCommunity As System.Windows.Forms.Label
    Friend WithEvents lblSNMPErrorRetryCt As System.Windows.Forms.Label
    Friend WithEvents lblSNMPTimeout As System.Windows.Forms.Label
    Friend WithEvents lblIPAddress As System.Windows.Forms.Label
    Friend WithEvents cmdGetStatistics As System.Windows.Forms.Button
    Friend WithEvents txtSNMP_RW As System.Windows.Forms.TextBox
    Friend WithEvents txtSNMP_ReadOnly As System.Windows.Forms.TextBox
    Friend WithEvents txtSNMP_Retry As System.Windows.Forms.TextBox
    Friend WithEvents txtSNMP_timeout As System.Windows.Forms.TextBox
    Friend WithEvents txtSNMP_IPaddress As System.Windows.Forms.TextBox
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl
    Friend WithEvents txtICMP_log As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.txtICMP_log = New System.Windows.Forms.TextBox()
        Me.cmdCloseSysMgmt = New System.Windows.Forms.Button()
        Me.tbSNMPSetup = New System.Windows.Forms.TabPage()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.lstMibs = New System.Windows.Forms.ListBox()
        Me.lblSNMPRWCommunity = New System.Windows.Forms.Label()
        Me.lblSNMPReadCommunity = New System.Windows.Forms.Label()
        Me.lblSNMPErrorRetryCt = New System.Windows.Forms.Label()
        Me.lblSNMPTimeout = New System.Windows.Forms.Label()
        Me.lblIPAddress = New System.Windows.Forms.Label()
        Me.cmdGetStatistics = New System.Windows.Forms.Button()
        Me.txtSNMP_RW = New System.Windows.Forms.TextBox()
        Me.txtSNMP_ReadOnly = New System.Windows.Forms.TextBox()
        Me.txtSNMP_Retry = New System.Windows.Forms.TextBox()
        Me.txtSNMP_timeout = New System.Windows.Forms.TextBox()
        Me.txtSNMP_IPaddress = New System.Windows.Forms.TextBox()
        Me.TabControl1 = New System.Windows.Forms.TabControl()
        Me.tbSNMPSetup.SuspendLayout()
        Me.TabControl1.SuspendLayout()
        Me.SuspendLayout()
        '
        'txtICMP_log
        '
        Me.txtICMP_log.Location = New System.Drawing.Point(0, 0)
        Me.txtICMP_log.Name = "txtICMP_log"
        Me.txtICMP_log.Size = New System.Drawing.Size(100, 20)
        Me.txtICMP_log.TabIndex = 0
        '
        'cmdCloseSysMgmt
        '
        Me.cmdCloseSysMgmt.Location = New System.Drawing.Point(343, 391)
        Me.cmdCloseSysMgmt.Name = "cmdCloseSysMgmt"
        Me.cmdCloseSysMgmt.Size = New System.Drawing.Size(96, 40)
        Me.cmdCloseSysMgmt.TabIndex = 6
        Me.cmdCloseSysMgmt.Text = "Close SNMP"
        '
        'tbSNMPSetup
        '
        Me.tbSNMPSetup.Controls.Add(Me.Label1)
        Me.tbSNMPSetup.Controls.Add(Me.lstMibs)
        Me.tbSNMPSetup.Controls.Add(Me.lblSNMPRWCommunity)
        Me.tbSNMPSetup.Controls.Add(Me.lblSNMPReadCommunity)
        Me.tbSNMPSetup.Controls.Add(Me.lblSNMPErrorRetryCt)
        Me.tbSNMPSetup.Controls.Add(Me.lblSNMPTimeout)
        Me.tbSNMPSetup.Controls.Add(Me.lblIPAddress)
        Me.tbSNMPSetup.Controls.Add(Me.cmdGetStatistics)
        Me.tbSNMPSetup.Controls.Add(Me.txtSNMP_RW)
        Me.tbSNMPSetup.Controls.Add(Me.txtSNMP_ReadOnly)
        Me.tbSNMPSetup.Controls.Add(Me.txtSNMP_Retry)
        Me.tbSNMPSetup.Controls.Add(Me.txtSNMP_timeout)
        Me.tbSNMPSetup.Controls.Add(Me.txtSNMP_IPaddress)
        Me.tbSNMPSetup.Location = New System.Drawing.Point(4, 22)
        Me.tbSNMPSetup.Name = "tbSNMPSetup"
        Me.tbSNMPSetup.Size = New System.Drawing.Size(445, 351)
        Me.tbSNMPSetup.TabIndex = 0
        Me.tbSNMPSetup.Text = "SNMP Setup"
        Me.tbSNMPSetup.UseVisualStyleBackColor = True
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(16, 187)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(176, 24)
        Me.Label1.TabIndex = 12
        Me.Label1.Text = "Report Mibs"
        '
        'lstMibs
        '
        Me.lstMibs.FormattingEnabled = True
        Me.lstMibs.Items.AddRange(New Object() {"SNMP_RFC1213_MIB_system", "SNMP_RFC1213_MIB_ifTable", "SNMP_RFC1213_MIB_ipRouteTable", "SNMP_RFC1213_MIB_ipAddrTable", "SNMP_RFC1213_MIB_icmp"})
        Me.lstMibs.Location = New System.Drawing.Point(216, 187)
        Me.lstMibs.Name = "lstMibs"
        Me.lstMibs.Size = New System.Drawing.Size(211, 69)
        Me.lstMibs.TabIndex = 11
        '
        'lblSNMPRWCommunity
        '
        Me.lblSNMPRWCommunity.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSNMPRWCommunity.Location = New System.Drawing.Point(16, 152)
        Me.lblSNMPRWCommunity.Name = "lblSNMPRWCommunity"
        Me.lblSNMPRWCommunity.Size = New System.Drawing.Size(176, 24)
        Me.lblSNMPRWCommunity.TabIndex = 10
        Me.lblSNMPRWCommunity.Text = "SNMP R/W Community Name"
        '
        'lblSNMPReadCommunity
        '
        Me.lblSNMPReadCommunity.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSNMPReadCommunity.Location = New System.Drawing.Point(16, 120)
        Me.lblSNMPReadCommunity.Name = "lblSNMPReadCommunity"
        Me.lblSNMPReadCommunity.Size = New System.Drawing.Size(176, 24)
        Me.lblSNMPReadCommunity.TabIndex = 9
        Me.lblSNMPReadCommunity.Text = "SNMP Read Community Name"
        '
        'lblSNMPErrorRetryCt
        '
        Me.lblSNMPErrorRetryCt.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSNMPErrorRetryCt.Location = New System.Drawing.Point(16, 88)
        Me.lblSNMPErrorRetryCt.Name = "lblSNMPErrorRetryCt"
        Me.lblSNMPErrorRetryCt.Size = New System.Drawing.Size(176, 24)
        Me.lblSNMPErrorRetryCt.TabIndex = 8
        Me.lblSNMPErrorRetryCt.Text = "SNMP Error Retry Ct"
        '
        'lblSNMPTimeout
        '
        Me.lblSNMPTimeout.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSNMPTimeout.Location = New System.Drawing.Point(16, 56)
        Me.lblSNMPTimeout.Name = "lblSNMPTimeout"
        Me.lblSNMPTimeout.Size = New System.Drawing.Size(176, 24)
        Me.lblSNMPTimeout.TabIndex = 7
        Me.lblSNMPTimeout.Text = "SNMP Timeout (ms)"
        '
        'lblIPAddress
        '
        Me.lblIPAddress.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblIPAddress.Location = New System.Drawing.Point(16, 24)
        Me.lblIPAddress.Name = "lblIPAddress"
        Me.lblIPAddress.Size = New System.Drawing.Size(168, 24)
        Me.lblIPAddress.TabIndex = 6
        Me.lblIPAddress.Text = "IP Address"
        '
        'cmdGetStatistics
        '
        Me.cmdGetStatistics.Location = New System.Drawing.Point(331, 288)
        Me.cmdGetStatistics.Name = "cmdGetStatistics"
        Me.cmdGetStatistics.Size = New System.Drawing.Size(96, 40)
        Me.cmdGetStatistics.TabIndex = 5
        Me.cmdGetStatistics.Text = "Get SNMP data"
        '
        'txtSNMP_RW
        '
        Me.txtSNMP_RW.Enabled = False
        Me.txtSNMP_RW.Location = New System.Drawing.Point(216, 152)
        Me.txtSNMP_RW.Name = "txtSNMP_RW"
        Me.txtSNMP_RW.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
        Me.txtSNMP_RW.Size = New System.Drawing.Size(101, 20)
        Me.txtSNMP_RW.TabIndex = 4
        Me.txtSNMP_RW.Text = "private"
        '
        'txtSNMP_ReadOnly
        '
        Me.txtSNMP_ReadOnly.Location = New System.Drawing.Point(216, 120)
        Me.txtSNMP_ReadOnly.Name = "txtSNMP_ReadOnly"
        Me.txtSNMP_ReadOnly.PasswordChar = Global.Microsoft.VisualBasic.ChrW(42)
        Me.txtSNMP_ReadOnly.Size = New System.Drawing.Size(101, 20)
        Me.txtSNMP_ReadOnly.TabIndex = 3
        Me.txtSNMP_ReadOnly.Text = "wmi_snmp"
        '
        'txtSNMP_Retry
        '
        Me.txtSNMP_Retry.Location = New System.Drawing.Point(216, 88)
        Me.txtSNMP_Retry.Name = "txtSNMP_Retry"
        Me.txtSNMP_Retry.Size = New System.Drawing.Size(48, 20)
        Me.txtSNMP_Retry.TabIndex = 2
        Me.txtSNMP_Retry.Text = "2"
        '
        'txtSNMP_timeout
        '
        Me.txtSNMP_timeout.Location = New System.Drawing.Point(216, 56)
        Me.txtSNMP_timeout.Name = "txtSNMP_timeout"
        Me.txtSNMP_timeout.Size = New System.Drawing.Size(101, 20)
        Me.txtSNMP_timeout.TabIndex = 1
        Me.txtSNMP_timeout.Text = "500"
        '
        'txtSNMP_IPaddress
        '
        Me.txtSNMP_IPaddress.Location = New System.Drawing.Point(216, 24)
        Me.txtSNMP_IPaddress.Name = "txtSNMP_IPaddress"
        Me.txtSNMP_IPaddress.Size = New System.Drawing.Size(101, 20)
        Me.txtSNMP_IPaddress.TabIndex = 0
        Me.txtSNMP_IPaddress.Text = "127.0.0.1"
        '
        'TabControl1
        '
        Me.TabControl1.Controls.Add(Me.tbSNMPSetup)
        Me.TabControl1.Location = New System.Drawing.Point(8, 8)
        Me.TabControl1.Name = "TabControl1"
        Me.TabControl1.SelectedIndex = 0
        Me.TabControl1.Size = New System.Drawing.Size(453, 377)
        Me.TabControl1.TabIndex = 0
        '
        'frmSNMPMgmt
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(489, 452)
        Me.Controls.Add(Me.cmdCloseSysMgmt)
        Me.Controls.Add(Me.TabControl1)
        Me.Name = "frmSNMPMgmt"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "SNMP Device Support"
        Me.tbSNMPSetup.ResumeLayout(False)
        Me.tbSNMPSetup.PerformLayout()
        Me.TabControl1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

#Region " constants, structures "



    Private m_ipaddress As String = ""
    Public Property ipAddress() As String
        Get
            ipAddress = m_ipaddress
        End Get
        Set(ByVal value As String)
            If value <> "" Then
                m_ipaddress = value
                Me.txtSNMP_IPaddress.Text = value
            End If
        End Set
    End Property



    Private Function translateCimType _
            (ByVal sourceColumnType As CimType) _
            As System.Type

        Select Case LCase(sourceColumnType.ToString)
            Case "sint8"
                Return Type.GetType("System.SByte")
            Case "uint8"
                Return Type.GetType("System.Byte")
            Case "sint16"
                Return Type.GetType("System.Int16")
            Case "uint16"
                Return Type.GetType("System.UInt16")
            Case "sint32"
                Return Type.GetType("System.Int32")
            Case "uint32"
                Return Type.GetType("System.UInt32")
            Case "sint64"
                Return Type.GetType("System.Int64")
            Case "uint64"
                Return Type.GetType("System.UInt64")
            Case "real32"
                Return Type.GetType("System.Single")
            Case "real64"
                Return Type.GetType("System.Double")
            Case "boolean"
                Return Type.GetType("System.Boolean")
            Case "string"
                Return Type.GetType("System.String")
            Case "datetime"
                Return Type.GetType("System.DateTime")
            Case "reference"
                Return Type.GetType("System.Int16")
            Case "object"
                Return Type.GetType("System.Object")
            Case Else
                Return Type.GetType("System.Empty")
        End Select

    End Function

    '
    ' pass in a swbemobject and a blank table to create a table definition
    '
    Private Sub buildCimTable(ByRef cimObject As WbemScripting.SWbemObject, _
                            ByRef m_dt As System.Data.DataTable)

        Try

            Dim wbemProps As WbemScripting.SWbemPropertySet
            Dim wbemProp As WbemScripting.SWbemProperty
            Dim objType As System.Type

            Dim m_dc As System.Data.DataColumn = New System.Data.DataColumn
            wbemProps = cimObject.Properties_
            ' if the datatable columns haven't been created then add them
            For Each wbemProp In wbemProps
                m_dc = Nothing
                m_dc = New System.Data.DataColumn
                objType = translateCimType(cimObject.Properties_.Item(wbemProp.Name).CIMType)
                m_dc.DataType = objType
                m_dc.ColumnName = wbemProp.Name
                m_dt.Columns.Add(m_dc)
            Next

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try


    End Sub

    '
    ' pass in a swbemobject and a blank record, update the record
    '
    Private Sub buildCimRecord(ByRef cimObject As WbemScripting.SWbemObject, _
                               ByRef m_dr As System.Data.DataRow)

        Try

            Dim wbemProps As WbemScripting.SWbemPropertySet
            Dim wbemProp As WbemScripting.SWbemProperty
            Dim objType As System.Type
            Dim objCimType As CimType

            wbemProps = cimObject.Properties_
            Dim objValue As Object
            For Each wbemProp In wbemProps
                If Not IsNothing(cimObject.Properties_.Item(wbemProp.Name).Value) Then
                    objCimType = cimObject.Properties_.Item(wbemProp.Name).CIMType
                    objType = translateCimType(objCimType)
                    objValue = cimObject.Properties_.Item(wbemProp.Name).Value
                    m_dr.Item(wbemProp.Name) = objValue
                Else
                    objCimType = cimObject.Properties_.Item(wbemProp.Name).CIMType
                    objType = translateCimType(objCimType)
                    Select Case objType.ToString
                        Case "System.String"
                            m_dr.Item(wbemProp.Name) = ""
                        Case "System.Boolean"
                            m_dr.Item(wbemProp.Name) = False
                        Case "System.DateTime"
                            m_dr.Item(wbemProp.Name) = #1/1/2001#
                        Case Else
                            m_dr.Item(wbemProp.Name) = 0
                    End Select
                End If
            Next wbemProp

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        End Try

    End Sub

#End Region

#Region " build the report table "

    ' *********************************************************************
    ' get the system information



    Public Function buildSnmpReportTable _
                (ByVal strMibName As String) _
                 As System.Data.DataTable

        Dim objWmiLocator As WbemScripting.SWbemLocator
        Dim objWmiServices As WbemScripting.SWbemServices
        Dim objWmiNamedValueSet As WbemScripting.SWbemNamedValueSet
        Dim colTable As WbemScripting.SWbemObjectSet
        Dim cimObject As WbemScripting.SWbemObject

        Dim strTargetSnmpDevice As String ' need an address
        Dim strReadCommunity As String
        Dim intAgentRetryTimeout As Short
        Dim intAgentRetryCount As Short

        Dim m_dt As System.Data.DataTable = New DataTable
        Try

            strTargetSnmpDevice = txtSNMP_IPaddress.Text  ' ip address
            intAgentRetryTimeout = txtSNMP_timeout.Text ' give it one second
            intAgentRetryCount = txtSNMP_Retry.Text ' retry once
            strReadCommunity = txtSNMP_ReadOnly.Text

            'subLogMessage("start locator")

            objWmiLocator = CreateObject("WbemScripting.SWbemLocator")
            objWmiServices = objWmiLocator.ConnectServer("", "root\snmp\localhost")

            'subLogMessage("create the object")

            objWmiNamedValueSet = CreateObject("WbemScripting.SWbemNamedValueSet")
            objWmiNamedValueSet.Add("AgentAddress", strTargetSnmpDevice)
            objWmiNamedValueSet.Add("AgentReadCommunityName", strReadCommunity)
            objWmiNamedValueSet.Add("AgentRetryTimeOut", intAgentRetryTimeout)
            objWmiNamedValueSet.Add("AgentRetryCount", intAgentRetryCount)

            colTable = objWmiServices.InstancesOf(strMibName, , objWmiNamedValueSet)


            Dim m_dr As DataRow = Nothing

            For Each cimObject In colTable
                If m_dt.Rows.Count < 1 Then
                    buildCimTable(cimObject, m_dt)
                End If
                m_dr = m_dt.NewRow
                buildCimRecord(cimObject, m_dr)
                m_dt.Rows.Add(m_dr)
            Next cimObject

        Catch err As Exception
            Dim rethrow As Boolean = ExceptionPolicy.HandleException(err, "Log Only Policy")
            If (rethrow) Then
                Throw
            End If
        Finally
            buildSnmpReportTable = m_dt
        End Try

    End Function


    Private Sub buildReport(ByVal intReport As Integer, _
                            ByVal dtReport As System.Data.DataTable)

        Dim frmExport As visRackSysMgmt.frmReportViewer = New visRackSysMgmt.frmReportViewer(intReport, dtReport)
        frmExport.ShowDialog()
        frmExport.Dispose()
        frmExport = Nothing

    End Sub




#End Region

#Region " form event handling "

    Private Sub cmdGetStatistics_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetStatistics.Click

        ' first report for basic system information

        Dim m_dt As System.Data.DataTable = New System.Data.DataTable
        Dim intReport As Integer = -1
        Dim strSelect As String = Me.lstMibs.SelectedItem

        Select Case strSelect
            Case "SNMP_RFC1213_MIB_system"
                intReport = visRackSysMgmt.clsDC_RackReporting.baseReports.rptSnmpSystem
                m_dt = buildSnmpReportTable(strSelect)
            Case "SNMP_RFC1213_MIB_ifTable"
                intReport = visRackSysMgmt.clsDC_RackReporting.baseReports.rptSnmpInterfaces
                m_dt = buildSnmpReportTable(strSelect)
            Case "SNMP_RFC1213_MIB_ipRouteTable"
                intReport = visRackSysMgmt.clsDC_RackReporting.baseReports.rptSnmpRoute
                m_dt = buildSnmpReportTable(strSelect)
            Case "SNMP_RFC1213_MIB_ipAddrTable"
                intReport = visRackSysMgmt.clsDC_RackReporting.baseReports.rptSnmpAddrTable
                m_dt = buildSnmpReportTable(strSelect)
            Case "SNMP_RFC1213_MIB_icmp"
                intReport = visRackSysMgmt.clsDC_RackReporting.baseReports.rptSnmpIcmp
                m_dt = buildSnmpReportTable(strSelect)
        End Select

        buildReport(intReport, m_dt)

    End Sub




    Private Sub cmdCloseSysMgmt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCloseSysMgmt.Click
        Me.Close()
    End Sub

#End Region

End Class
